
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="RIDE" /> 
<meta name="rf-template" content="False" /> 
<style type="text/css">
html {
  font-family: Arial,Helvetica,sans-serif;
  background-color: white;
  color: black;
}
table {
  border-collapse: collapse;
  empty-cells: show;
  margin: 1em 0em;
  border: 0.1em solid black;
}
th, td {
  border-style: solid;
  border-width: 0.05em 0.1em;
  border-color: black;
  padding: 0.1em 0.2em;
  height: 1.5em;
  width: 12em;
}
th {
  background-color: rgb(192, 192, 192);
  color: black;
  border-width: 0.1em;
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.1em;
}
td.name {
  background-color: rgb(240, 240, 240);
  letter-spacing: 0.1em;
}
td.name, th.name {
  width: 10em;
}
</style>
<title>Dbconnect</title>
</head>
<body>
<h1>Dbconnect</h1>
<table id="settings" border="1">
<tr>
<th class="name">Setting</th>
<th colspan="4">Value</th>
</tr>
<tr>
<td class="name">Test Setup</td>
<td>Clear Database</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name">Test Timeout</td>
<td>10 seconds</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name">Library</td>
<td>OperatingSystem</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<table id="variables" border="1">
<tr>
<th class="name">Variable</th>
<th colspan="4">Value</th>
</tr>
<tr>
<td class="name">${dbname}</td>
<td>jeremy</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name">${password}</td>
<td>password</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<table id="testcases" border="1">
<tr>
<th class="name">Test Case</th>
<th>Action</th>
<th colspan="3">Arguments</th>
</tr>
<tr>
<td class="name"><a name="test_Connect">Connect</a></td>
<td>[Documentation]</td>
<td colspan="3">Delete the table, run the setup application, verify that the table is created.</td>
</tr>
<tr>
<td class="name"></td>
<td>[Timeout]</td>
<td>10 seconds</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${setupexe} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>setup</td>
<td>bufdb_setup</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${response} =</td>
<td>Run</td>
<td>${setupexe} -U %{USER} -p password -d ${dbname}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${response} =</td>
<td>SQL</td>
<td>SELECT * FROM roster;</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${response}</td>
<td>name</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${response}</td>
<td>batting_avg</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${response} =</td>
<td>SQL</td>
<td>SELECT * FROM league;</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${response}</td>
<td>name</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${response}</td>
<td>city</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"><a name="test_Just Client">Just Client</a></td>
<td>[Documentation]</td>
<td colspan="3">Test the client with a server that just prints out the message debug string.</td>
</tr>
<tr>
<td class="name"></td>
<td>${serverexe} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>client</td>
<td>fake_server</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${clientexe} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>client</td>
<td>bufdb_client</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${testpath} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>client</td>
<td>test.txt</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${first} =</td>
<td>Start Process</td>
<td>${serverexe}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${second} =</td>
<td>Run</td>
<td>${clientexe} -w ${testpath} localhost</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Sleep</td>
<td>0.1</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${output} =</td>
<td>Read Process Output</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${output}</td>
<td>write: true</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${player} =</td>
<td>Player Entry</td>
<td>Dustin Padroia</td>
<td>0.314</td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${output}</td>
<td>${player}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${player} =</td>
<td>Player Entry</td>
<td>Big Papi</td>
<td>0.203</td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${output}</td>
<td>${player}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${player} =</td>
<td>Player Entry</td>
<td>Hanley Ramirez</td>
<td>0.315</td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${output}</td>
<td>${player}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${player} =</td>
<td>Player Entry</td>
<td>Albert Pojols</td>
<td>0.336</td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${output}</td>
<td>${player}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${team} =</td>
<td>Team Entry</td>
<td>Red Sox</td>
<td>Boston</td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${output}</td>
<td>${team}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${team} =</td>
<td>Team Entry</td>
<td>Marlins</td>
<td>Florida</td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${output}</td>
<td>${team}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${team} =</td>
<td>Team Entry</td>
<td>Cardinals</td>
<td>St. Louis</td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${output}</td>
<td>${team}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>[Teardown]</td>
<td>Stop All Processes</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"><a name="test_Just Server">Just Server</a></td>
<td>[Documentation]</td>
<td colspan="3">Test the server with a fake client that sends a known message.</td>
</tr>
<tr>
<td class="name"></td>
<td>${setupexe} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>setup</td>
<td>bufdb_setup</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${serverexe} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>server</td>
<td>bufdb_server</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${clientexe} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>server</td>
<td>fake_client</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${response} =</td>
<td>Run</td>
<td>${setupexe} -U %{USER} -p password -d ${dbname}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${first} =</td>
<td>Start Process</td>
<td>${serverexe} -U %{USER} -p password -d ${dbname} 2&gt; server.log</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${client_err} =</td>
<td>Run</td>
<td>${clientexe} localhost 2&gt;&amp;1</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Sleep</td>
<td>2</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Stop Process</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${roster} =</td>
<td>SQL</td>
<td>SELECT * FROM roster;</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${roster}</td>
<td>Alex Rodriguez</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${league} =</td>
<td>SQL</td>
<td>SELECT * FROM league;</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${league}</td>
<td>Yankees</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>[Teardown]</td>
<td>Stop All Processes</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"><a name="test_Populate Database">Populate Database</a></td>
<td>[Documentation]</td>
<td colspan="3">Populate the database with test data and check it afterwards.</td>
</tr>
<tr>
<td class="name"></td>
<td>${serverexe} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>server</td>
<td>bufdb_server</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${clientexe} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>client</td>
<td>bufdb_client</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${testpath} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>client</td>
<td>test.txt</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${setupexe} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>setup</td>
<td>bufdb_setup</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${response} =</td>
<td>Run</td>
<td>${setupexe} -U %{USER} -p password -d ${dbname}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${first} =</td>
<td>Start Process</td>
<td>${serverexe} -U %{USER} -p password -d ${dbname} 2&gt; server.log</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${response} =</td>
<td>Run</td>
<td>${clientexe} -w ${testpath} localhost</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Sleep</td>
<td>1</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Stop Process</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${roster} =</td>
<td>SQL</td>
<td>SELECT * FROM roster;</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${roster}</td>
<td>Big Papi</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>[Teardown]</td>
<td>Stop All Processes</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"><a name="test_Query Database">Query Database</a></td>
<td>${setupexe} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>setup</td>
<td>bufdb_setup</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${serverexe} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>server</td>
<td>bufdb_server</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${clientexe} =</td>
<td>Join Path</td>
<td>${CURDIR}</td>
<td>..</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>client</td>
<td>bufdb_client</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${response} =</td>
<td>Run</td>
<td>${setupexe} -U %{USER} -p password -d ${dbname}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${response} =</td>
<td>SQL</td>
<td>INSERT INTO roster(name,batting_avg) values('Jason Giambi','0.259');</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${response} =</td>
<td>SQL</td>
<td>INSERT INTO league(name,city) values('Phillies','Philidelphia, PA');</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>Start Process</td>
<td>${serverexe} -U %{USER} -p password -d ${dbname}</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${output} =</td>
<td>Run</td>
<td>${clientexe} localhost</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${player} =</td>
<td>Player Entry</td>
<td>Jason Giambi</td>
<td>0.259</td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${output}</td>
<td>${player}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>${team} =</td>
<td>Team Entry</td>
<td>Phillies</td>
<td>Philadelphia, PA</td>
</tr>
<tr>
<td class="name"></td>
<td>Should Contain</td>
<td>${output}</td>
<td>${player}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>[Teardown]</td>
<td>Stop All Processes</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<table id="keywords" border="1">
<tr>
<th class="name">Keyword</th>
<th>Action</th>
<th colspan="3">Arguments</th>
</tr>
<tr>
<td class="name"><a name="keyword_SQL">SQL</a></td>
<td>[Arguments]</td>
<td>${command}</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>[Documentation]</td>
<td colspan="3">Use postgres to alter or query the database.</td>
</tr>
<tr>
<td class="name"></td>
<td>${response} =</td>
<td>Run</td>
<td>psql -U %{USER} -d ${dbname} -c "${command}"</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>[Return]</td>
<td>${response}</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"><a name="keyword_Roster Entry">Roster Entry</a></td>
<td>[Arguments]</td>
<td>${name}</td>
<td>${average}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>[Documentation]</td>
<td colspan="3">The debug string for a roster entry</td>
</tr>
<tr>
<td class="name"></td>
<td>${format} =</td>
<td>roster {\n\ \ name: "${name}"\n\ \ batting_avg: ${average}\n}</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>[Return]</td>
<td>${format}</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"><a name="keyword_Team Entry">Team Entry</a></td>
<td>[Arguments]</td>
<td>${name}</td>
<td>${city}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>[Documentation]</td>
<td colspan="3">The debug string for a roster entry</td>
</tr>
<tr>
<td class="name"></td>
<td>${format} =</td>
<td>Catenate</td>
<td>league {\n\ \ name: "${name}"\n\ \ city: "${city}"\n}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>[Return]</td>
<td>${format}</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"><a name="keyword_Player Entry">Player Entry</a></td>
<td>[Arguments]</td>
<td>${name}</td>
<td>${average}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>[Documentation]</td>
<td colspan="3">The debug string for a roster entry</td>
</tr>
<tr>
<td class="name"></td>
<td>${format} =</td>
<td>Catenate</td>
<td>roster {\n\ \ name: "${name}"\n\ \ batting_avg: ${average}\n}</td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td>[Return]</td>
<td>${format}</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"><a name="keyword_Clear Database">Clear Database</a></td>
<td>:FOR</td>
<td>${table}</td>
<td>IN</td>
<td>roster</td>
</tr>
<tr>
<td class="name"></td>
<td>...</td>
<td>league</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td>${response} =</td>
<td>SQL</td>
<td>DROP TABLE ${table};</td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td>${response} =</td>
<td>SQL</td>
<td>SELECT * FROM ${table};</td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td>Should Contain</td>
<td>${response}</td>
<td>ERROR</td>
</tr>
<tr>
<td class="name"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
